package com.ruoyi.procured.mapper;

import java.util.List;
import com.ruoyi.procured.domain.RequestAdvance;

/**
 * 申请预付款Mapper接口
 * 
 * @author ruoyi
 * @date 2023-11-22
 */
public interface RequestAdvanceMapper 
{
    /**
     * 查询申请预付款
     * 
     * @param requestId 申请预付款主键
     * @return 申请预付款
     */
    public RequestAdvance selectRequestAdvanceByRequestId(Long requestId);

    /**
     * 查询申请预付款列表
     * 
     * @param requestAdvance 申请预付款
     * @return 申请预付款集合
     */
    public List<RequestAdvance> selectRequestAdvanceList(RequestAdvance requestAdvance);

    /**
     * 新增申请预付款
     * 
     * @param requestAdvance 申请预付款
     * @return 结果
     */
    public int insertRequestAdvance(RequestAdvance requestAdvance);


    /**
     * 修改申请预付款
     * 
     * @param requestAdvance 申请预付款
     * @return 结果
     */
    public int updateRequestAdvance(RequestAdvance requestAdvance);

    /**
     * 删除申请预付款
     * 
     * @param requestId 申请预付款主键
     * @return 结果
     */
    public int deleteRequestAdvanceByRequestId(Long requestId);

    /**
     * 批量删除申请预付款
     * 
     * @param requestIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRequestAdvanceByRequestIds(Long[] requestIds);


    /**
     * 最大可申请多少钱
     * @param ordersId
     * @return
     */
    public RequestAdvance selectTotalAmountDue(Long ordersId);

    /**
     * 审核通过要取消申请按钮
     * @param requestIds
     * @return
     */
    public int updateRequestAdvanceCancelStatus(Long[] requestIds);

    /**
     * 付款完成需要修改申请记录的付款状态
     * @param requestIds
     * @return
     */
    public int updateRequestAdvancePaymentStatus(Long[] requestIds);
}
